package demo;

public class TeacherTest {
    public static void main(String[] args) {
        // 带参构造方法创建对象.并赋值
        Teacher t1 = new Teacher("张三", 30);
        System.out.println(t1.getName() + " " + t1.getAge());

        // 空参构造方法创建对象,配合set方法完成赋值
        Teacher t2 = new Teacher();
        t2.setName("李四");
        t2.setAge(40);
        System.out.println(t2.getName() + " " + t2.getAge());
    }
}
